package pub.guoxin.oops.manager.handler;

import pub.guoxin.oops.enums.ComparisonOperator;
import pub.guoxin.oops.model.DataAlarmConfig;

/**
 * 一个边界值
 * <p>
 * Create by guoxin on 2018/3/30
 */
public abstract class AbstractOneBoundaryAlarmInfoHandler extends AbstractAlarmInfoHandler {

    protected ComparisonOperator judgmentBoundaryValue(Float value, String fieldName) {
        DataAlarmConfig deviceBattery = dataAlarmConfigRepository.findByFieldName(fieldName);
        Float min = (Float) deviceBattery.getBoundary().getMin();
        return value <= min ? ComparisonOperator.LESS_THAN : ComparisonOperator.NORMAL;
    }


}
